package cn.bupt.sse309.ydl.activity;

import cn.bupt.sse309.ydl.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener {
  private Button loginBtn, registerBtn, forgetPasswordBtn, resetPasswordBtn, userProtocolBtn,
      setingBtn, userKnowBtn, helpBtn, userManualBtn, feedbackBtn, aboutBtn,
      shareBtn,mineBtn;

  @Override
  protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.activity_main);
    this.initView();
  }

  /**
   *
   */
  public void initView() {
    // TODO Auto-generated method stub
    this.loginBtn = (Button) this.findViewById(R.id.btn_login);
    this.registerBtn = (Button) this.findViewById(R.id.btn_register);
    this.forgetPasswordBtn = (Button) this.findViewById(R.id.btn_forgetpassword);
    this.resetPasswordBtn = (Button) this.findViewById(R.id.btn_reset_password);
    this.userProtocolBtn = (Button) this.findViewById(R.id.btn_userprotocol);
    this.setingBtn = (Button) this.findViewById(R.id.btn_setting);
    this.userKnowBtn = (Button) this.findViewById(R.id.btn_user_know);
    this.helpBtn = (Button) this.findViewById(R.id.btn_help);
    this.userManualBtn = (Button) this.findViewById(R.id.btn_user_manual);
    this.feedbackBtn = (Button) this.findViewById(R.id.btn_feedback);
    this.aboutBtn = (Button) this.findViewById(R.id.btn_about);
    this.shareBtn=(Button) this.findViewById(R.id.btn_share);
    this.mineBtn=(Button) this.findViewById(R.id.btn_mine);
    this.loginBtn.setOnClickListener(this);
    this.registerBtn.setOnClickListener(this);
    this.forgetPasswordBtn.setOnClickListener(this);
    this.resetPasswordBtn.setOnClickListener(this);
    this.userProtocolBtn.setOnClickListener(this);
    this.setingBtn.setOnClickListener(this);
    this.userKnowBtn.setOnClickListener(this);
    this.helpBtn.setOnClickListener(this);
    this.userManualBtn.setOnClickListener(this);
    this.feedbackBtn.setOnClickListener(this);
    this.aboutBtn.setOnClickListener(this);

    this.shareBtn.setOnClickListener(this);
    this.mineBtn.setOnClickListener(this);

  }

  /*
   * (non-Javadoc)
   *
   * @see android.view.View.OnClickListener#onClick(android.view.View)
   */
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
    case R.id.btn_login:
      Intent intent1 = new Intent(MainActivity.this, LoginActivity.class);
      this.startActivity(intent1);
      break;
    case R.id.btn_register:
      Intent intent2 = new Intent(MainActivity.this, RegisterActivity.class);
      this.startActivity(intent2);
      break;
    case R.id.btn_forgetpassword:
      Intent intent3 = new Intent(MainActivity.this, ForgetPasswActivity.class);
      this.startActivity(intent3);
      break;
    case R.id.btn_reset_password:
      Intent intent4 = new Intent(MainActivity.this, ResetPasswordActivity.class);
      this.startActivity(intent4);
      break;
    case R.id.btn_setting:
      Intent intent5 = new Intent(MainActivity.this, SettingActivity.class);
      this.startActivity(intent5);
      break;
    case R.id.btn_userprotocol:
      Intent intent6 = new Intent(MainActivity.this, UserProtocolActivity.class);
      this.startActivity(intent6);
      break;
    case R.id.btn_feedback:
      Intent intent7 = new Intent(MainActivity.this, UserFeedbackActivity.class);
      this.startActivity(intent7);
      break;
    case R.id.btn_user_know:
      Intent intent8 = new Intent(MainActivity.this, UserKnowActivity.class);
      this.startActivity(intent8);
      break;
    case R.id.btn_user_manual:
      Intent intent9 = new Intent(MainActivity.this, UserManualActivity.class);
      this.startActivity(intent9);
      break;
    case R.id.btn_about:
      Intent intent10 = new Intent(MainActivity.this, AboutActivity.class);
      this.startActivity(intent10);
      break;
    case R.id.btn_help:
      Intent intent11 = new Intent(MainActivity.this, HelpActivity.class);
      this.startActivity(intent11);
      break;

//    case R.id.btn_share:
//      Intent intent12 = new Intent(MainActivity.this, ShareActivity.class);
//      this.startActivity(intent12);
//      break;
    case R.id.btn_mine:
      Intent intent13 = new Intent(MainActivity.this, MineActivity.class);
      this.startActivity(intent13);
      break;

    default:
      break;
    }

  }

}
